import request from "@/utils/request";

//渲染列表
export function getleiBiao(params) {
  return request({
    url: "http://localhost:3001/data",
    method: "GET",
    params,
  });
}

//删除列表
export function deleteshanChu(id) {
  return request({
    url: `http://localhost:3001/data/${id}`,
    method: "DELETE",
  });
}

//搜索接口
export function getshouSuo(data) {
  return request({
    url: `http://localhost:3001/data/?name=${data}`,
    method: "GET",
  });
}

//新增接口
export function postxinZeng(data) {
  return request({
    url: "http://localhost:3001/data",
    method: "post",
    data,
  });
}

//修改接口
export function putbianJi(data) {
  return request({
    url: `http://localhost:3001/data/${data.id}`,
    method: "PUT",
    data: data,
  });
}

//详情接口
export function getxiangQing(id) {
  return request({
    url: `http://localhost:3001/data/${id}`,
    method: "GET",
  });
}
